#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
void* my_memmove(void* dest, void* src, size_t num) {
	char* ret = dest;
	assert(dest && src);
	if (dest < src) {
		while (num--) {
			*((char*)dest) = *((char*)src);
			src = (char*)src + 1;
			dest = (char*)dest + 1;
		}
	}
	else {
		while (num--) {
			*((char*)dest + num) = *((char*)src + num);
		}
	}
	return ret;
}
int main() {
	int a[] = { 1,2,3,4,5,6,7,8,9,10 };
	my_memmove(a,a+5,20);
	int i = 0;
	for (i = 0; i < 10; i++) {
		printf("%d ", a[i]);
	}
	return 0;
}